package com.runa.rccprotocol.dto.equdata;

import java.util.Date;

/**
 * 阀门数据
 */
public class ValveData extends EquData {

    private Date readTime;

    //分摊标志，true是通断控制器、false是温控
    private boolean apportion;

    private boolean switchState;

    private int updateIden;

    private double accHeat;

    private long standby1;

    private int openValveTime;

    private int standby2;

    private byte standby3;

    private int reportPeriod;

    private long standby4;

    private int valveOpenUpLimit;

    private int valveOpenDownLimit;

    private int valveLockIden;

    private float valveLockTarget;

    private int temperatureLockIden;

    private float temperatureLockTarget;

    private float temperatureDownLimit;

    private float temperatureUpLimit;

    private double temperatureCompen;

    private double allowTemperatureDiff;

    private byte prepaidRemind;

    private byte arrearageRemind;

    private byte accHeatDisplaySign;

    private byte openValveTimeDisplaySign;

    private long standby5;

    private float inTemperature;

    private float outTemperature;

    private Date date;

    private String status;

    private float valveOpen;

    private float standby6;

    private int valveVersion;

    private float currTemperature;

    private float setTemperature;

    private Panel panel0;

    private Panel panel1;

    private Panel panel2;

    private int collectPeriod;

    private int apportionPeriod;

    private int standby7;

    private int currApportionPeriodOpenValveTime;

    private float currApportionPeriodAvgTemperature;

    private Date currApportionPeriodStartDate;

    private int currApportionPeriodCollectTime;

    private long standby8;

    private float recentlyApportionPeriodHeat;

    private float recentlyApportionPeriodProp;

    private int recentlyApportionPeriodOpenValveTime;

    private float recentlyApportionPeriodAvgTemperature;

    private Date recentlyApportionPeriodStartDate;

    private Date recentlyApportionPeriodEndDate;

    private String ipv4;

    private int ipPort;

    public String getIpv4() {
        return ipv4;
    }

    public void setIpv4(String ipv4) {
        this.ipv4 = ipv4;
    }

    public int getIpPort() {
        return ipPort;
    }

    public void setIpPort(int ipPort) {
        this.ipPort = ipPort;
    }

    public boolean isApportion() {
        return apportion;
    }

    public void setApportion(boolean apportion) {
        this.apportion = apportion;
    }

    public Date getReadTime() {
        return readTime;
    }

    public void setReadTime(Date readTime) {
        this.readTime = readTime;
    }

    public boolean getSwitchState() {
        return switchState;
    }

    public void setSwitchState(boolean switchState) {
        this.switchState = switchState;
    }

    public static class Panel extends EquData{
        public int counter;
        public int version;
        public float temperature;
        public short status;

        public Panel(int counter, int version, float temperature, short status) {
            this.counter = counter;
            this.version = version;
            this.temperature = temperature;
            this.status = status;
            if ((status & 0xffff) == 0xffff) {
                super.setSuccess(false);
            } else {
                StringBuilder faults = new StringBuilder();
                if ((status >> 8 & 1) == 1) {
                    faults.append("电池欠压").append(",");
                }
                if ((status >> 9 & 1) == 1) {
                    faults.append("温度异常").append(",");
                }
                super.setFaults(faults.toString());
            }
        }
    }

    public int getUpdateIden() {
        return updateIden;
    }

    public void setUpdateIden(int updateIden) {
        this.updateIden = updateIden;
    }

    public double getAccHeat() {
        return accHeat;
    }

    public void setAccHeat(double accHeat) {
        this.accHeat = accHeat;
    }

    public long getStandby1() {
        return standby1;
    }

    public void setStandby1(long standby1) {
        this.standby1 = standby1;
    }

    public int getOpenValveTime() {
        return openValveTime;
    }

    public void setOpenValveTime(int openValveTime) {
        this.openValveTime = openValveTime;
    }

    public int getStandby2() {
        return standby2;
    }

    public void setStandby2(int standby2) {
        this.standby2 = standby2;
    }

    public byte getStandby3() {
        return standby3;
    }

    public void setStandby3(byte standby3) {
        this.standby3 = standby3;
    }

    public int getReportPeriod() {
        return reportPeriod;
    }

    public void setReportPeriod(int reportPeriod) {
        this.reportPeriod = reportPeriod;
    }

    public long getStandby4() {
        return standby4;
    }

    public void setStandby4(long standby4) {
        this.standby4 = standby4;
    }

    public int getValveOpenUpLimit() {
        return valveOpenUpLimit;
    }

    public void setValveOpenUpLimit(int valveOpenUpLimit) {
        this.valveOpenUpLimit = valveOpenUpLimit;
    }

    public int getValveOpenDownLimit() {
        return valveOpenDownLimit;
    }

    public void setValveOpenDownLimit(int valveOpenDownLimit) {
        this.valveOpenDownLimit = valveOpenDownLimit;
    }

    public int getValveLockIden() {
        return valveLockIden;
    }

    public void setValveLockIden(int valveLockIden) {
        this.valveLockIden = valveLockIden;
    }

    public float getValveLockTarget() {
        return valveLockTarget;
    }

    public void setValveLockTarget(float valveLockTarget) {
        this.valveLockTarget = valveLockTarget;
    }

    public int getTemperatureLockIden() {
        return temperatureLockIden;
    }

    public void setTemperatureLockIden(int temperatureLockIden) {
        this.temperatureLockIden = temperatureLockIden;
    }

    public float getTemperatureLockTarget() {
        return temperatureLockTarget;
    }

    public void setTemperatureLockTarget(float temperatureLockTarget) {
        this.temperatureLockTarget = temperatureLockTarget;
    }

    public float getTemperatureDownLimit() {
        return temperatureDownLimit;
    }

    public void setTemperatureDownLimit(float temperatureDownLimit) {
        this.temperatureDownLimit = temperatureDownLimit;
    }

    public float getTemperatureUpLimit() {
        return temperatureUpLimit;
    }

    public void setTemperatureUpLimit(float temperatureUpLimit) {
        this.temperatureUpLimit = temperatureUpLimit;
    }

    public double getTemperatureCompen() {
        return temperatureCompen;
    }

    public void setTemperatureCompen(double temperatureCompen) {
        this.temperatureCompen = temperatureCompen;
    }

    public double getAllowTemperatureDiff() {
        return allowTemperatureDiff;
    }

    public void setAllowTemperatureDiff(double allowTemperatureDiff) {
        this.allowTemperatureDiff = allowTemperatureDiff;
    }

    public byte getPrepaidRemind() {
        return prepaidRemind;
    }

    public void setPrepaidRemind(byte perpaidRemind) {
        this.prepaidRemind = perpaidRemind;
    }

    public byte getArrearageRemind() {
        return arrearageRemind;
    }

    public void setArrearageRemind(byte arrearageRemind) {
        this.arrearageRemind = arrearageRemind;
    }

    public byte getAccHeatDisplaySign() {
        return accHeatDisplaySign;
    }

    public void setAccHeatDisplaySign(byte accHeatDisplaySign) {
        this.accHeatDisplaySign = accHeatDisplaySign;
    }

    public byte getOpenValveTimeDisplaySign() {
        return openValveTimeDisplaySign;
    }

    public void setOpenValveTimeDisplaySign(byte openValveTimeDisplaySign) {
        this.openValveTimeDisplaySign = openValveTimeDisplaySign;
    }

    public long getStandby5() {
        return standby5;
    }

    public void setStandby5(long standby5) {
        this.standby5 = standby5;
    }

    public float getInTemperature() {
        return inTemperature;
    }

    public void setInTemperature(float inTemperature) {
        this.inTemperature = inTemperature;
    }

    public float getOutTemperature() {
        return outTemperature;
    }

    public void setOutTemperature(float outTemperature) {
        this.outTemperature = outTemperature;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public float getValveOpen() {
        return valveOpen;
    }

    public void setValveOpen(float valveOpen) {
        this.valveOpen = valveOpen;
    }

    public float getStandby6() {
        return standby6;
    }

    public void setStandby6(float standby6) {
        this.standby6 = standby6;
    }

    public int getValveVersion() {
        return valveVersion;
    }

    public void setValveVersion(int valveVersion) {
        this.valveVersion = valveVersion;
    }

    public float getCurrTemperature() {
        return currTemperature;
    }

    public void setCurrTemperature(float currTemperature) {
        this.currTemperature = currTemperature;
    }

    public float getSetTemperature() {
        return setTemperature;
    }

    public void setSetTemperature(float setTemperature) {
        this.setTemperature = setTemperature;
    }

    public Panel getPanel0() {
        return panel0;
    }

    public void setPanel0(Panel panel0) {
        this.panel0 = panel0;
    }

    public Panel getPanel1() {
        return panel1;
    }

    public void setPanel1(Panel panel1) {
        this.panel1 = panel1;
    }

    public Panel getPanel2() {
        return panel2;
    }

    public void setPanel2(Panel panel2) {
        this.panel2 = panel2;
    }

    public int getCollectPeriod() {
        return collectPeriod;
    }

    public void setCollectPeriod(int collectPeriod) {
        this.collectPeriod = collectPeriod;
    }

    public int getApportionPeriod() {
        return apportionPeriod;
    }

    public void setApportionPeriod(int apportionPeriod) {
        this.apportionPeriod = apportionPeriod;
    }

    public int getStandby7() {
        return standby7;
    }

    public void setStandby7(int standby7) {
        this.standby7 = standby7;
    }

    public int getCurrApportionPeriodOpenValveTime() {
        return currApportionPeriodOpenValveTime;
    }

    public void setCurrApportionPeriodOpenValveTime(int currApportionPeriodOpenValveTime) {
        this.currApportionPeriodOpenValveTime = currApportionPeriodOpenValveTime;
    }

    public float getCurrApportionPeriodAvgTemperature() {
        return currApportionPeriodAvgTemperature;
    }

    public void setCurrApportionPeriodAvgTemperature(float currApportionPeriodAvgTemperature) {
        this.currApportionPeriodAvgTemperature = currApportionPeriodAvgTemperature;
    }

    public Date getCurrApportionPeriodStartDate() {
        return currApportionPeriodStartDate;
    }

    public void setCurrApportionPeriodStartDate(Date currApportionPeriodStartDate) {
        this.currApportionPeriodStartDate = currApportionPeriodStartDate;
    }

    public int getCurrApportionPeriodCollectTime() {
        return currApportionPeriodCollectTime;
    }

    public void setCurrApportionPeriodCollectTime(int currApportionPeriodCollectTime) {
        this.currApportionPeriodCollectTime = currApportionPeriodCollectTime;
    }

    public long getStandby8() {
        return standby8;
    }

    public void setStandby8(long standby8) {
        this.standby8 = standby8;
    }

    public float getRecentlyApportionPeriodHeat() {
        return recentlyApportionPeriodHeat;
    }

    public void setRecentlyApportionPeriodHeat(float recentlyApportionPeriodHeat) {
        this.recentlyApportionPeriodHeat = recentlyApportionPeriodHeat;
    }

    public float getRecentlyApportionPeriodProp() {
        return recentlyApportionPeriodProp;
    }

    public void setRecentlyApportionPeriodProp(float recentlyApportionPeriodProp) {
        this.recentlyApportionPeriodProp = recentlyApportionPeriodProp;
    }

    public int getRecentlyApportionPeriodOpenValveTime() {
        return recentlyApportionPeriodOpenValveTime;
    }

    public void setRecentlyApportionPeriodOpenValveTime(int recentlyApportionPeriodOpenValveTime) {
        this.recentlyApportionPeriodOpenValveTime = recentlyApportionPeriodOpenValveTime;
    }

    public float getRecentlyApportionPeriodAvgTemperature() {
        return recentlyApportionPeriodAvgTemperature;
    }

    public void setRecentlyApportionPeriodAvgTemperature(float recentlyApportionPeriodAvgTemperature) {
        this.recentlyApportionPeriodAvgTemperature = recentlyApportionPeriodAvgTemperature;
    }

    public Date getRecentlyApportionPeriodStartDate() {
        return recentlyApportionPeriodStartDate;
    }

    public void setRecentlyApportionPeriodStartDate(Date recentlyApportionPeriodStartDate) {
        this.recentlyApportionPeriodStartDate = recentlyApportionPeriodStartDate;
    }

    public Date getRecentlyApportionPeriodEndDate() {
        return recentlyApportionPeriodEndDate;
    }

    public void setRecentlyApportionPeriodEndDate(Date recentlyApportionPeriodEndDate) {
        this.recentlyApportionPeriodEndDate = recentlyApportionPeriodEndDate;
    }

    @Override
    public EquDataType equDataType() {
        return EquDataType.VALVE;
    }
}
